package com.atguigu.order.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

/**
 * 订单配置类
 * 对应配置前缀: order
 */
@Data
@Component
@ConfigurationProperties(prefix = "order")
@RefreshScope
public class OrderProperties {

    /**
     * 订单超时时间（秒）
     * 对应配置: order.timeout
     */
    private Integer timeout = 30;

    /**
     * 最大重试次数
     * 对应配置: order.retryMax
     */
    private Integer retryMax = 3;

    /**
     * 订单开关状态
     * 对应配置: order.switchEnabled
     */
    private Boolean switchEnabled = true;

}